import { useState, useEffect } from "react";

export default function App() {
    const [count, setCount] = useState(0)
    const handleClick = () => {
        setCount(count + 1)    
    }
    useEffect(() => {
        console.log(count);
        
    },[count])
    return (
        <>
            <h1>useEffect</h1>
            <button onClick={handleClick}>++</button>
            <br />
            {count}
        </>
    )
}